/**********************************************************************************
***
***    Screencasting Teaching System C++ Library
***    Copyright (C) 2011  Jiri Novak <jiri.novak@petriny.net>
***                        Wadi Jalil Maluf <wadijm@gmail.com>
***
***    This file is part of the Screencasting Teaching System C++ Library.
***
***    This library is free software; you can redistribute it and/or modify
***    it under the terms of the GNU General Public License as published by
***   the Free Software Foundation; either version 3 of the License, or
***    (at your option) any later version.
***
***    This library is distributed in the hope that it will be useful,
***    but WITHOUT ANY WARRANTY; without even the implied warranty of
***    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
***   GNU General Public License for more details.
***
***    You should have received a copy of the GNU General Public License
***    along with this library; if not, write to the Free Software
***    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
***
*********************************************************************************/

#ifndef SCREENCASTING_TEACHING_SYSTEM___COMMON___MODEL___USER_H_
#define SCREENCASTING_TEACHING_SYSTEM___COMMON___MODEL___USER_H_

#include <string>
#include <list>
#include "lesson.h"
#include "course.h"
#include "../comm/mutex.h"
#include "../comm/lock.h"
/**
 *
 */
class User {
public:
	User();
	virtual ~User();

	bool isInstructor() const { return instructor; }
	int getId() const { return id; }
	void setId(int id) { this->id = id; }
	std::string getPassword() const { return password; }
	std::string getUser() const { return user; }
	void setPassword(std::string password) { this->password = password; }
	void setUser(std::string user) { this->user = user; }
	bool getInstructor() const { return instructor; }
	std::string getName() const { return name; }
	void setInstructor(bool instructor) { this->instructor = instructor; }
	void setName(std::string name) { this->name = name; }
	void setLogged();
	void logout();
	bool isLogged() const { return logged; }

	bool isListeningLesson()const { return listeningLesson; };
	void setListeningLesson(bool val) { this->listeningLesson = val; }
private:
	bool instructor;
	std::string name;
	std::list<Course*> subscibedCourses;
	std::list<Lesson*> subscibedLessons;
	std::string user;
	std::string password;
	int id;
	bool logged;
	bool listeningLesson;
	Mutex mutex;
};

#endif /* SCREENCASTING_TEACHING_SYSTEM___COMMON___MODEL___USER_H_ */
